import request from '@/utils/request'

// 获取不同类型模板下拉列表（v2版本）
export function getMessageTypeDictListV2(typeValue) {
  return request({
    url: '/basic/web/tuisong/config/getMessageTypeDictList/v2',
    method: 'get',
    params: { typeValue }
  })
}

// 获取不同类型通道下拉列表
export function getChannelTypeDictList(typeValue) {
  return request({
    url: '/basic/web/tuisong/config/getChannelTypeDictList',
    method: 'get',
    params: { typeValue }
  })
}

// 查询APP推送配置列表
export function getAppPushConfigList(params) {
  return request({
    url: '/basic/web/tuisong/config/list',
    method: 'get',
    params
  })
}

// 获取APP推送配置详细信息
export function getAppPushConfigDetail(id) {
  return request({
    url: `/basic/web/tuisong/config/${id}`,
    method: 'get'
  })
}

// 新增APP推送配置
export function addAppPushConfig(data) {
  return request({
    url: '/basic/web/tuisong/config',
    method: 'post',
    data
  })
}

// 修改APP推送配置
export function updateAppPushConfig(data) {
  return request({
    url: '/basic/web/tuisong/config',
    method: 'put',
    data
  })
}

// 删除APP推送配置
export function deleteAppPushConfig(ids) {
  return request({
    url: `/basic/web/tuisong/config/${ids}`,
    method: 'delete'
  })
}

// 测试配置
export function testAppPushConfig(configId) {
  return request({
    url: `/basic/web/tuisong/config/test/${configId}`,
    method: 'get'
  })
}